Motion sensing system with adaptive timing for controlling lighting fixtures

ABSTRACT

A system for selectively providing power from a power source to a load to operate in an area for at least one occupant comprising a processing device for controlling the opening and closing of a relay connected between the load and the power source for energizing the load, and a sensor for detecting the presence of an occupant in the area. The processing device is programmable to close the relay in response to an output signal from the sensor for a period of time that can be of fixed duration, or a duration that is dynamically and automatically determined using sensor data relating to measured time between successive, detected occupant movements. In addition to a daylight inhibit function, the system is provided with color indicators and a tone generator to indicate various operating conditions and to guide a user entering selected system parameters, among other features.

This application is a division of application Ser. No. 08/823,154, nowU.S. Pat. No. 5,946,209, filed Mar. 25, 1997, which is a continuation ofapplication Ser. No. 08/412,502, filed Mar. 29, 1995, U.S. Pat. No.5,699,243, which is a continuation of application Ser. No. 08/382,691,filed Feb. 2, 1995, now abandoned.

FIELD OF THE INVENTION

The invention relates to a motion sensing apparatus for controllinglighting fixtures and, more particularly, to a motion sensinog apparatuswhich automatically and dynamically increases or decreases the length oftime lighting fixtures are powered up to accommodate occupants in thelighted area.

BACKGROUND OF THE INVENTION

Many commercial, industrial and government facilities require asignificant number of lighting fixtures for adequate illumination, andtherefore use a significant amount of power to operate the fixtures. Toreduce power consumed to light these facilities, a number of facilitiesuse lighting control systems which control when the lighting fixturesare energized. For example, a step-dimming system, such as the two-levellighting control system disclosed in U.S. Pat. No. 5,216,333 toNuckolls, can be used to switch facility fixtures between energy-savinglow level or reduced-wattage operation and full level or normal-wattageoperation in accordance with output signals from a motion sensor.Step-dimming systems can respond to other conditions besides occupancylevel such as ambient light level, time, and manual switching. U.S. Pat.No. 4,713,598 to Smith discloses another device for controllablyswitching an AC line to energize a load. The device uses a passiveinfrared detector to sense motion.

Passive infrared wall switch sensors such as H-MOSS® motion switchingsystem models 1500A and 750A, manufactured by Hubbell Incorporated ofBridgeport, Conn., can be used to automatically power up incandescent orfluorescent lighting fixtures upon detection of occupant motion, and topower down the fixtures after a predetermined period of time has elapsedfollowing the last instance of detected motion. This period of timeshall hereinafter be referred to as the time out (TO) period. These wallmounted switches provide adjustable TO periods, that is, the personinstalling the switch can specify the duration of the TO period byselecting and entering a numerical value corresponding to the desiredduration of the TO period from a range of values. In addition, the 1500Amodel has a photocell device for controlling lighting fixtures inaccordance with detected ambient light levels. In either model, theduration of the TO period remains fixed until it is manually adjusted bya person.

These lighting control devices are characterized by a number ofdrawbacks. For example, if the fixed TO period is too long, the wallswitch does not realize maximum energy and cost savings. If the fixed TOperiod is too short, the wall switch powers down lighting fixtures whilean occupant is still in the lighted area.

SUMMARY OF THE INVENTION

The present invention overcomes these drawbacks and realizes a number ofadvantages over existing controlled switching systems. In accordancewith the present invention, a system for selectively providing powerfrom a power source to a load is provided comprising:

a relay configured to provide a current conduction path between a powerline and load (e.g., a lighting fixture) when in a closed position, andto interrupt the path when in an open position;

a processing device connected to the relay for controlling when therelay is in an open position and when the relay is in a closed position;

a memory device associated with said processing device for storingprogram code and parameters, one or more of which can be specified by asystem user, the processing device being operable to control the relayin accordance with the program code and the parameter; and

a sensor for detecting when an occupant has entered an area, which canbe illuminated by the lighting fixtures, and providing an output signalto the processing device;

wherein the processing device is programmable to close the relay inresponse to the output signal for a period of time, the duration ofwhich is determined automatically by the processing device.

In accordance with an aspect of the present invention, the switchingsystem, which is hereinafter referred to as a lighting control systemfor illustrative purposes, operates in an adaptive timing mode wherebyit automatically and dynamically adjusts the TO period according to theneeds of occupants of a lighted area.

In accordance with another aspect of the invention, the lighting controlsystem operates in a fixed timing mode which can be set by a user andwhich powers up lighting fixtures for a fixed TO period specified by theuser. A switch is provided to configure the lighting control system tooperate in either a fixed or an adaptive timing mode.

In accordance with another aspect of the present invention, theparameters need not be user-specified. The system is provided withdefault settings which are factory programmable and factory set.

In accordance with another aspect of the invention, a lighting controlsystem comprises a switch which can be depressed by a user to selectbetween manual and automatic modes of operation.

In accordance with another aspect of the invention, the lighting controlsystem notifies the occupants of a lighted area via an audible tone ofthe impending power down of the lighting fixtures, giving the occupantsthe opportunity to respond by moving, e.g., changing an amount of energymeasured by a detector or breaking an optical beam or creating atemperature differential that is detected. If the motion is detected,the lighting control system extends the TO period if the adaptive timingmode of operation is selected.

In accordance with still another aspect of the invention, the lightingcontrol system comprises a processing device and a non-volatile memorydevice for storing a history of values corresponding to respective timesbetween detected movements (TBMs) for calculating a decaying average ofsuccessive TBMs to adjust the TO period. Alternatively, the processingdevice can store an ongoing average in its random access memory.

In accordance with still another aspect of the invention, the lightingcontrol system comprises a photocell sensor to override automatic powerup of the lighting fixtures when ambient light level is sufficient. Thedesired ambient light level is entered by a user activating a switch onthe housing of the lighting control system when the user regards theambient light level in the area to be sufficient. The ambient lightlevel at the time of switch activation is stored using a processingdevice and a memory device. The system does not require calibration todetermine a numerically accurate ambient light level (e.g., number offoot-candles) for ambient light user-setting purposes.

In accordance with still another aspect of the invention, the lightingcontrol system comprises a number of light emitting diodes (LEDs) toindicate a number of conditions such as when the switch has been set fordaylight override, when the lighting fixtures are powered up, whenmotion is detected, when user data is being entered, and during datafeedback.

Color, duty cycle, brightness, pulse width and operating frequency ofthe LEDs are used to indicate various conditions and information to auser. The LEDs can also provide data in a serial, coded mode to indicateunit operating serial number, software version number and failure modes.

In accordance with still another aspect of the invention, the lightingcontrol system comprises an LED driver circuit which conserves currentdrawn by the LEDs. The driver circuit powers up the LED to a brightlevel and then reduces LED output using pulses that are imperceptible tothe human eye. Pulsing can be accomplished in accordance with oneembodiment of the invention by dynamically varying the duty cycle via adigital processing device or other switching device. In accordance withanother embodiment of the invention, LED pulsing can be generated usingan analog circuit to modulate a steady state output signal of a digitalprocessing device or other switching device.

In accordance with still another aspect of the invention, the lightingcontrol system is configured to detect zero-crossing of the lightingload circuit and comprises a processing device to coordinate delaysassociated with the relay and other circuit components withzero-crossing detection.

In accordance with another aspect of the invention, the lighting controlsystem comprises a processing device for specifying whether the controlsystem is operating in an intolerant mode or a tolerant mode. A tolerantmode of operation requires more detected motion data to trigger thepower up of the fixtures. The lighting control system is therefore moreimmune to noise than during the intolerant mode of operation.

In accordance with another aspect of the invention, the processingdevice analyzes data, that is, light triggering events and timesettings, to determine occupants' active and nonactive periods andadjusts the TO value accordingly.

In accordance with another aspect of the invention, the lighting controlsystem is configured to receive signals from a data input device whichdownloads data such as a user-specified TO value and other set-upparameters.

In accordance with another aspect of the invention, an external datainput device can be connected to the wall housing or set at themanufacturing facility to download a pass code authorizing the user toadjust Dual Inline Package (DIP) switch positions and/or depressmomentary push buttons on the wall housing or lock-out the push buttons.

In accordance with still yet another aspect of the invention, the usercan press selected buttons simultaneously or in certain predeterminedsequence to enter a pass code in lieu of using an external data inputdevice.

In accordance with another aspect of the invention, the setting switchesfor the lighting control system are readily available on auser-accessible surface of the wall mounted housing.

In accordance with another aspect of the invention, the lighting controlsystem is contained in a wall mounted housing comprising terminals forconnection to a power source in lieu of being provided with pig tails.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other features and advantages of the present invention will bemore readily apprehended from the following detailed description whenread in connection with the appended drawings, which form a part of thisoriginal disclosure, and wherein:

FIG. 1 is an overall view of a lighting control system mounted on a wallfor controlling suspended lighting fixtures, and constructed inaccordance with an embodiment of the present invention;

FIG. 2 is a perspective view of the front and back sections of a wallhousing constructed in accordance with an embodiment of the presentinvention to contain the lighting control system;

FIG. 3 is a perspective view of the front section of the wall housingdepicted in FIG. 2;

FIG. 4 is a perspective view of the back section of the wall housingdepicted in FIG. 2;

FIGS. 5 through 10 and 16 are schematic circuit diagrams of the lightingcontrol system constructed in accordance with an embodiment of thepresent invention;

FIG. 11 is a graph illustrating duty cycling performed by a processingdevice to provide a bright flash and then reduce current drawn by an LEDin accordance with an embodiment of the present invention;

FIG. 12 is a schematic diagram of an analog LED driver circuitconstructed in accordance with an embodiment of the present invention toprovide a bright flash and then reduce current drawn by an LED;

FIG 13 is a graph illustrating a decrease in the current drawn by an LEDdriven by the circuit of FIG. 12;

FIGS. 14A, 14B(i), 14B(ii) and 14C are flowcharts illustrating anoverall sequence of operations for the lighting control system inaccordance with an embodiment of the present invention;

FIGS. 15A and 15B are a flow chart depicting a sequence of operationsfor adjusting the motion time out value (MTV) during the adaptive timingmode in accordance with an embodiment of the present invention;

FIG. 17 is a power supply control circuit constructed in accordance withanother embodiment of the present invention;

FIG. 18A and 18B are a flow chart depicting a sequence of operations forperforming a factory test of a lighting control system in accordancewith an embodiment of the present invention;

FIG. 19 is a schematic diagram of software and hardware signalprocessing components of the lighting control system for implementingtolerant and intolerant modes of operation in accordance with anembodiment of the present invention; and

FIGS. 20 and 21 are perspective views of a printed circuit board onwhich the lighting control system can be mounted which is constructed inaccordance with an embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

A switching system 10 constructed in accordance with the invention isshown in FIG. 1. The switching system 10 of the present invention isimplemented with lighting fixtures for illustrative purposes and istherefore hereinafter referred to as a lighting control system 10. Thecontrol system, however, can be used with a number of different types ofloads such as HVAC, security and temperature control systems. Thelighting control system is secured to a wall 12 preferably 41 to 53inches vertically from the floor. The height is selected to enable themotion sensor in the lighting control system to detect when an occupant16 is walking in proximity of the sensor. As will be described below,the lighting control system controls the powering up and down oflighting fixtures 14 which are typically mounted overhead to a ceiling18.

While the lighting control system 10 is shown in FIG. 1 secured to awall in a room with ceiling-mounted lighting fixtures, the system 10 canbe installed in outdoor areas, as well as indoor areas, for use with orwithout overhead lighting fixtures (e.g., floor lamps can be used).Further, it can be mounted on various surfaces such as the ceiling or ona vertical support or an angled wedge and at various heights to detect,for example, persons sitting in or walking about the lighted area. Theterm "lighted area" defines the area served by the lighting fixturescontrolled by a lighting control system 10, and does not necessarilyimply that the fixtures are powered up.

With reference to FIG. 2, the lighting control system 10 is preferablycontained in a rectangular housing 24 which protrudes from the wall 12as shown in FIG. 1. The housing can be, for example, molded from apaintable copolymer material (e.g., an acrylonitrile butadiene styrene(ABS) copolymer) or a nylon material. The housing comprises a frontportion 25 and a back portion 27 which are preferably detachably securedto each other using a bracket that is snap-fitted to protruding, plasticmolded members 29 on the exterior surface of the housing. The housing 24preferably comprises a Style Line-type housing which has been modifiedto comprise a different push button plate 26. The push button plate 26is obscured from view in FIG. 2 by a hinged door 32. The push buttonplate 26 is shown in FIG. 3 wherein the door 32 has been removed toprovide a better view of the plate 26. The door can be secured to thefront portion 25 of the housing 24 so as to be hinged in a conventionalmanner such as by providing the door with two plastic molded,articulated members that are received in corresponding recesses 33 and34.

With continued reference to FIGS. 2 and 3, the housing 24 comprises anaperture 28 in the top portion 25 thereof to accommodate the lens of amotion sensor and a photocell therein. An aperture 30 is also providedon the housing to accommodate at least one light emitting diode (LED)via a light pipe 36. The light pipe can be secured within the housing 24using glue, or snap-fit in the housing or on the PCB. The push buttonplate 26 comprises apertures to accommodate a Front Press switch SW6, aDIP switch SW2, a TO set switch SW5, a daylight set switch SW4, and anair-gap ON/OFF switch SW1, which are described in further detail below.In accordance with an embodiment of the invention, the hinged door canbe substituted for and function as a Front Press switch SW4. The system10 is advantageous because it provides users with access to the buttonsand set switches on the push button plate 26 on the front portion 25 ofthe housing 24. Users are not required to remove the cover of thehousing or to use a tool (e.g., a screwdriver) in order to configure thesystem 10 via the buttons and set switches. Further, a printed set ofinstructions for using the buttons and set switches can be provided, forexample, on the hinged door.

FIG. 4 depicts the bottom portion 27 of the housing 24 with the topportion 25 of the housing 24 (shown in FIG. 3) removed. The bottomportion of the housing comprises a recess 44 for accommodating a printedcircuit board (PCB) 46. In accordance with an embodiment of theinvention, the PCB 46 is secured in the front portion 25 of the housingusing shelf members on the inside wall of the front portion 25. The PCBis described in more detail in connection with FIGS. 20 and 21. Thebottom portion 27 of the housing also comprises two sets of screwterminals 48 and 50, which are essentially identical. Each set of thescrew terminals comprises two or three recesses (e.g., recesses 49a and49b indicated in broken lines on terminal 48) for accommodating, forexample, a line wire, a neutral or common wire, and a ground wire, ifany, extending from a lighting fixture, or from an AC power supply forthe lighting fixture, to the lighting control system 10. Each recess(e.g., recess 49b) is configured to receive an individual wire (e.g.,wire 51). A screw 52 is provided in each terminal to make electricalcontact via conductive members 54 and 55 between the wires in the screwterminals 48 and 50, respectively, and a slide switch SW1, a transformerT1, a bridge rectifier circuit 73, a metal-oxide varistor (MOV), a relayK1 and a capacitor C1 on the PCB 46, which are shown in FIG. 16, whenthe screw is tightened. A jack 56 is provided as an interface betweenthe lighting control system 10 and an external device described below.

The housing 24 is advantageous to use over existing wall-mountedswitching devices or wall boxes which do not have terminals, but ratherapertures for accepting power lines in the housing thereof. The powerlines are typically connected to pig tails in the housing 24 using wirenuts. The pig tails and the wire nuts use considerable space within thewall box. Thus, a number of wall-mounted switches are too deep for usein a wall recess adapted for a conventional gang box. The terminal sets48 and 50 eliminate the need to use wire nuts inside the wall box.

With reference to FIG. 5, the lighting control system 10 comprises thefollowing circuit components which are mounted in a conventional manneron the printed circuit board 46 secured inside the housing 24: (1) amicroprocessor 70 and an associated memory device such as anelectrically erasable programmable read-only memory (EEPROM) 72; (2)with reference to FIGS. 16 or 17, a transformer T1 and bridge rectifiercircuits 71 and 73 for converting AC power preferably from a 120 or 277volt AC (VAC) power source used to power up the lighting fixtures into aDC input power signal, e.g., 6.5 volt, 9 milliamp DC signal; (3) avoltage regulator VR1 (FIGS. 16 or 17) for supplying a 5 VDC signal tothe microprocessor and other circuit components requiring a regulatedvoltage signal; (4) a relay K1 and relay driver circuit 74 (FIG. 6) forselectively supplying power to the lighting fixtures 14 via the AC powerlines in response to an output signal from the microprocessor; (5) amotion sensing circuit 76 (FIG. 7); (6) a number of momentary pushbuttons and fixed, open or closed DIP switches indicated generally at 75(FIG. 8); (7) a buzzer BZ1 and buzzer driver circuit 78; (8) azero-crossing detection circuit 80 (FIGS. 16 or 17); (9) a photocell 82(FIG. 10) for detecting ambient light levels; (10) LEDs 84 (FIG. 9);(11) an LED driver circuit 86; and (12) an external input deviceinterface 88. In accordance with other embodiments of the invention, apower supply circuit as shown in FIG. 17 can be used in lieu of thepower supply circuit in FIG. 16. Further, LED driven circuits describedin connection with FIGS. 11, 12 and 13 can be used in lieu of circuit 86(FIG. 9).

The microprocessor 70 is preferably a microcontroller chip model no.MC68HC05P6DW manufactured by Motorola Inc. of Schaumburg, Ill. TheEEPROM 72 is preferably an integrated circuit model no. 93LC46/SNmanufactured by Microchip Technology Inc. of Chandler, Ariz. Themicroprocessor is programmed in accordance with program code stored theread-only-memory (ROM) and random access memory (RAM) on themicroprocessor chip and utilizes off-set values in the EEPROM. Theprogram code is described in more detail below in connection with theflow charts depicted in FIGS. 14 and 15. A number of parameters aredefined herein which can be changed in the program code withoutdeparting from the scope of the invention. These parameters include butare not limited to: (1) an adjustable TO value, hereinafter referred toas the motion sensor time out value (MTV), which is determined by themicroprocessor to be a value preferably between 1 and 30 minutes; (2) adefault TO value which is set to 15 minutes; (3) a fixed TO value whichis selected by a user and is typically a value between 1 and 30 minutes;and (4) a special TO value which is also selected by a user, and is avalue between 0 and 60 minutes or infinity.

As described above in connection with FIG. 3, an air-gap slide switchSW1 is provided as an ON/OFF switch to supply power to the system 10from a preferably 120 or 277 volt AC power source (not shown) whenever auser places the switch SW1 in the ON position. Other types of powersources can be employed. Further, other types of switches can be usedfor the ON/OFF switch such as a soft OFF switch implemented using amicroprocessor-controlled electromechanical switch. The air-gap switchis preferred for safety reasons. Relay K1 (e.g., model no. RP3SLA06manufactured by Schrack Components, Inc. of Ft. Lauderdale, Fla.) iscontrolled by the microprocessor 70 to selectively supply power signalsto the lighting fixtures from the 120 or 277 VAC power source. The coilof relay K1 is depicted in FIG. 6. The contact of relay K1 is shown inFIG. 16 and in FIG. 17.

The motion sensing circuit 76 (FIG. 7) preferably comprises a passiveinfrared (PIR) type sensor such as the pyro sensor model no. RE03HBBECmanufactured by Nippon Ceramic Co., Ltd. of Japan, which measureselectromagnetic radiation in the range of 8 to 14 microns. The pyrosensor is connected to an amplifier such as a dual op-amp circuit modelno. TLC27L2CD manufactured by Texas Instruments Inc. of Dallas, Tex. Thelens is preferably a model no. WSS1200 lens from Bryant Electric, Inc.of Milford, Conn. Whereas the Bryant lens unit typically outputs asignal indicating detected motion whenever measured PIR is outside a±0.5 volt threshold, the microprocessor is preferably programmed tooperate the relay K1 when a transition has occurred from the inside tothe outside of the ±0.5 volt threshold. The motion sensing circuit has atotal field of view of approximately 170 degrees, and an adjustablecoverage depth between 20 and 40 feet for an occupant walking through a670 to 6700 square foot area, and between 13 and 32 feet for an occupantworking in a 280 to 800 square foot area. Presence of an occupant can bedetected using a number of different techniques such as measuringchanges in the amount of energy measured by a detector, detecting thebreaking of an optical beam or a temperature differential.

The various momentary press buttons (MPB) and DIP switches on the pushbutton plate 26 will now be described in connection with FIG. 8. Thelighting control system comprises two position DIP switch SW2 (e.g.,model no. DS02 manufactured by Mors Components, Inc., Wakefield, Mass.which allows the user to configure the system to operate in either afixed timing or an adaptive timing mode. In addition to the selectingfixed or adaptive timing mode, the DIP switch SW2 also allows a user toselect between manual and automatic operation modes, which are describedbelow. Two separate switches can also be used, or the microprocessor canset them automatically. If the DIP switch SW2 is set for the fixedtiming mode, the microprocessor 70 controls the relay K1 to power up thelighting fixtures for a predetermined amount of time of fixed durationin response to detected motion. In contrast, if the DIP switch SW2 isset for the adaptive timing mode, the microprocessor controls the relayK1 to power up the lighting fixtures for an amount of time which is thesame as or greater than a user-selected, preprogrammed TO value,hereinafter referred to as the user-set TO value or UST. Themicroprocessor is programmed to analyze preprogrammed time settings andoccurrences of detected motion in a room and to automatically calculatean adjusted UST value to coincide as closely as possible with actualroom use. The adjusted UST value is preferably never less than the UST,and is also referred to as the motion TO value (MTV).

The user enters the desired UST into the lighting control system using aMPB-type TO set switch SW5 (FIG. 8) and a red LED 84' and green LED 84"(FIG. 9), and the buzzer 78, which are described below. If the user doesnot enter a selected TO value, the UST value defaults to 15 minutes, asstated previously. The lighting control system 10 therefore powers uplighting fixtures 14 in response to detected motion for 15 minutesunless the TO value is increased by the microprocessor 70 while in theadaptive timing mode, or is set manually to a different value.

The microprocessor 70 is programmed to accept input signals generatedwhen the TO set switch SW5 is depressed. The input signals indicate howmany times the TO set switch is depressed and for how long it is held ina depressed position by the user. To enter a UST value, the userdepresses the TO set switch SW5 once, and holds the TO set switch in thedepressed position between 3 and 6 seconds. The microprocessor 70responds by driving the buzzer BZ1 (FIG. 5) to generate a double tone.The microprocessor also drives the red and green LEDs 84' and 84" sothat the light pipe 36 appears to radiate an amber color. The user thendepresses the TO set switch SW5 once for each minute of the selected TOduration. The tone is generated, and the LEDs which illuminate the lightpipe are toggled, each time the TO set switch is depressed. If the TOset switch is not depressed again for 2 seconds after the last press,the last tone is generated. Further, the amber light pipe is flashed.The new UST corresponding to the number of presses is stored in theEEPROM 72. The MTV is reset to a zero value if the lighting controlsystem 10 is operating in the adaptive timing mode. Finally, the MTVhistory is cleared.

If the TO set switch SW5 (FIG. 8) is depressed once and held for lessthan 3 seconds and released, the microprocessor 70 drives the buzzer BZ1to generate a single tone. The microprocessor also drives the LEDs toflash the light pipe amber one time for every minute of the currentstored UST or MTV value, depending on whether the lighting controlsystem 10 is operating in the fixed or adaptive timing mode. If the TOset switch is depressed once and held for greater than 6 seconds beforeits release, the microprocessor 70 drives the buzzer BZ1 to generate adouble tone after 3 seconds have elapsed, drives the light pipe to flashan amber color, and then drives the buzzer to generate a triple toneafter 6 seconds have elapsed. The microprocessor subsequently resets theUST and the MTV to 15 minutes and stores the value in memory. During thesetting modes, tones are preferably not generated upon release of the TOset switch, but rather when the time delay of 3 or 6 seconds isexceeded. The tone is an indication to the user that he or she hasentered a certain mode and can, accordingly, release the TO set switchto select that mode without the aid of a stopwatch. Further, tones aregenerated to confirm that setting changes have been received, stored,and are ready to be used.

The lighting control system 10 can be configured to set the default toother values besides the 15 minute TO value using, for example, anon-masked component or programmable memory device on the PCB 46 that isloaded during manufacturing, or by downloading parameter values to theEEPROM 72 using an external input data device as described below.Further, a non-volatile memory (NVM) device can be used to storedifferent default values in order to preset a parameter at the factory.For example, a parameter stored in the NVM can be an offset value thatis added to a default value stored in microprocessor ROM.

In addition to a solid-colored, flashing or toggled amber light pipe,the red and green LEDs 84' and 84" (FIG. 9) themselves are also drivenby the microprocessor 70 in solid, flashing or toggled illuminationmodes. The LEDs are configured such that only one color (e.g., green,red or amber) radiates from aperture 30 (FIG. 2). Alternatively, LEDscan be arranged such that two or more colors can appear on the pushbutton plate 26 at one time. The red LED 84' is operated in a solidillumination mode when the lighting fixtures are powered down, and thelighting control system is not in the daylight inhibit mode. The red LEDis toggled off when motion is detected. The green LED 84" is driven in asolid illumination mode when the lighting fixtures are powered down andthen toggled when motion is detected to indicate that the lightingcontrol system is in the daylight inhibit mode. Thus, the red and greenLEDs together with the light pipe 36 provide feedback to the occupantregarding the lighting control system's functional state, and aidremotely located customer service personnel when helping an occupantidentify which mode the system is in and whether or not it ismalfunctioning (e.g., whether there is no input power, the system 10 isin the test mode, the TO value is too low, or the daylight thresholdvalue is too low). For example, when the lighting fixtures are powereddown, an illuminated green LED 84" provides a visible indication thatthe lighting control system is operational, but in a daylight inhibitmode. Occupants can therefore discern that the lighting control systemis not malfunctioning when energized lighting fixtures are desired, butrather is simply not functioning because the daylight threshold level isset below the current ambient light level.

An interactive daylight set switch SW6 (FIG. 8) is provided to selectwhether or not daylight override is desired and for entering the desiredambient light level, above which the lighting fixtures are not to bepowered up. The photocell 82 used for ambient light detection ispreferably a phototransistor model no. MRD901B manufactured by Motorola.The user sets an ambient light setting within a range of preferably 25foot-candles (ft-cd) and 300 ft-cd. The photocell 82 provides outputsignals to the microprocessor 70. The microprocessor compares thedetected ambient light levels with the stored, desired ambient lightlevel. The lighting fixtures are not powered up in response to detectedmotion if the stored, desired ambient light level is lower than thedetected ambient light level. While the room is occupied and thelighting fixtures are powered on, the photocell does not power down thelighting fixtures, even if the detected ambient light is less than theuser's setting. Further, the photocell does not affect the duration ofTO.

As will be described below, the stored ambient light level selected bythe user is adjustable between preferably a range of 25 and 300 ft-cd in1 to 3 ft-cd increments within an overall possible range of 1 and aninfinite number of ft-cd. The user begins to enter or change the storedvalue when the user believes the ambient light level in the room issufficient. Thus, the lighting fixtures may or may not be powered downat the time of setting. When the daylight set button is activated to setthe ambient light level, the lighting fixtures are preferably powereddown automatically. If the lighting fixtures are on beforehand, theyremain on during the photocell reading as well. Thus, the total ft-cdreading is now the ambient light level plus the system 10 light level.With this alternative method, it is not necessary to power down thelighting fixtures before taking a daylight level reading. The usersetting shall hereinafter be referred to as the current daylight setting(CDS). If the ambient light level detected by the photocell 82 isgreater than the CDS, the lighting fixtures remain powered down if theyare already powered down.

The microprocessor drives the LEDs to flash the light pipe an ambercolor several times and generates a corresponding number of tones viathe buzzer BZ1 when setting the ambient light level. The frequency withwhich the LEDs flash and the tones are generated increases just prior tothe first photocell reading to notify the user to step away from thehousing 24; otherwise, the user may cast a shadow on it. Themicroprocessor 70 is configured to receive a photocell reading, i.e., ameasured value in units ft-cd, approximately every 20 milliseconds for apredetermined period of time. A history of measured ambient light levelvalues is stored in the EEPROM 72. A measured ambient final value iscalculated, preferably by determining the average of the history ofvalues. The number of values in the history depends on the availabilityof memory space and the accuracy of the values. When memory spaceallocated for storing a history of measured values is exceeded, thestored values are overwritten on a first-in-first-out (FIFO) basis. Whenthe lighting control system is powered down, the factory default settingand the CDS are stored in the EEPROM 72. The factory default setting ispreferably with the daylight inhibit function disabled. Themicroprocessor is also programmed to calculate and store an activesetting for the CDS value, which is determined to be the CDS value minusan offset of preferably 15 ft-cd. The active CDS value is usedimmediately after setting the photocell as described below.

The daylight set switch SW6 (FIG. 8) is preferably a MPB-type switch. Toenter a CDS value, which corresponds to the current, desired level ofambient light in the room, the user depresses the daylight set switchand holds it for more than 3 seconds but less than 6 seconds beforereleasing it. As described above in connection with the TO set switch,the microprocessor 70 is programmed to drive the buzzer BZ1 to generatetwo tones. The LEDs are driven such that the light pipe appears toilluminate a flashing amber color.

The microprocessor is programmed to enter an ambient light levelmeasurement stage for approximately 30 seconds whereby photocellreadings are averaged and stored, commencing approximately 10 secondsafter the daylight set switch is released. The 30 second and 10 secondtime durations are variables stored in memory which can be set to othertime values and can be negative relative to the daylight set button.Every 0.5 seconds during the measurement stage, the buzzer tones forapproximately 0.1 seconds, and the light pipe flashes for approximately0.1 seconds. These two events preferably occur synchronously withrespect to each other. To do so, and to conserve power, the tone isgenerated and then the LED is flashed because sound travels slower thanlight. They therefore appear to occur synchronously. The readings arestored as a history of values. The average of these historical values,that is, the measured ambient light level final value, or the average ofthe ambient light measured is calculated and stored as the CDS. The LED84" is subsequently driven solid green to indicate that the lightingfixtures are powered down. The active CDS is determined and stored inthe memory device until the measured ambient light level is less thanthe active CDS, the lighting control system times out, or the FrontPress switch is depressed. The CDS is not used until the lightingcontrol system has timed out, or the lighting fixtures have been poweredup or down via the Front Press switch, or powered up via the motionsensor. The active setting or offset for the CDS is used to reduce thelikelihood of the lighting fixtures being powered up again immediatelyafter the system 10 exits the setting mode.

The use of a daylight set switch SW6 is advantageous over prior lightingcontrol systems which adjust ambient light settings using, for example,a potentiometer. These prior systems generally require a user to use ascrewdriver or other tool to adjust ambient light settings which is morecumbersome and less convenient than using the switch SW6. Further, theseprior systems generally require calibration of the light sensing deviceduring factory testing and use of numerically accurate ambient lightsettings (e.g., number of foot candles). The present invention, incontrast, compares stored, relative values corresponding to the ambientlight level desired by the user and measured ambient light levels.Photocell calibration is not required during factory testing because thesystem 10 uses the ambient light level reading as a relative readingwhen the occupant depresses the daylight set switch SW6. Themicroprocessor compares the actual ambient light level reading to theCDS. Thus, no calibration is required. It is possible a range check fordaylight setting can be done in the test mode, but it is not required.

If the user realizes he or she has made a mistake and does not wish toset the CDS to the current ambient light level in the room, the user candepress any switch except the daylight set switch while in themeasurement stage, and the previous ambient light settings remainunchanged. If the user depresses the daylight set switch SW6 for greaterthan 6 seconds, the microprocessor 70 is programmed to drive the buzzerBZ1 to generate two tones after 3 seconds and three tones after 6seconds. Further, the LEDs are driven such that the light pipe flashesamber. The microprocessor 70 changes the CDS to the default value if theswitch SW6 is released before 9 seconds have elapsed. The factorydefault maximum value has an upper limit setting of infinite ft-cd;however, this upper limit can be changed and the photocell can becompletely disabled. For example, the default value can be stored innon-masked areas on the PCB and loaded during manufacturing, ordownloaded via an external data input device. In addition, the defaultsetting can be preset in the factory in a non-volatile memory (NVM)device as an offset to a value stored in the microprocessor ROM.

As stated previously, the DIP switch SW2 (FIG. 8) can also be used toconfigure the lighting control system 10 to operate in accordance with amanual or an automatic mode of operation. The ability to configure thelighting control system 10 to operate in one of two available modes,that is, the manual or the automatic mode, presents a number ofadvantages over existing lighting control systems that use motionsensing, but only operate in an automatic mode. If the lighting controlsystem is in the manual mode, the use of two different colors for theLEDs enables occupants to know whether the lighting fixtures are powereddown due to the daylight inhibit function (i.e., the green LED isdriven) or simply because the lighting fixtures have been powered downafter the system has timed out (i.e., the red LED is driven). Asdescribed above, the daylight inhibit function prevents the lightingfixtures from being powered up even though an occupant may wish them tobe powered up. The daylight inhibit function can be overridden byactivating the Front Press switch and, therefore, powering up thelighting fixtures. When the system 10 detects motion and the lightingfixtures are prevented from being powered up, the LED is driven to asolid green. The occupant can therefore decide if he or she wishes tooverride the daylight inhibit setting by depressing the Front Pressswitch (a MPB-type switch SW4 in FIG. 16) to power up the lightingfixtures. The CDS is therefore overridden. In addition, if the lightingcontrol system is set for the manual mode of operation, or is set forthe automatic mode of operation and is currently in manual override, theLED is driven to a solid red when motion is detected. The system cantherefore be located in the dark, since the red LED functions as anactive night light.

During the manual mode of operation, lighting fixtures 14, which havebeen powered down, remain powered down when no occupant is in the roomfor a greater period of time than the TO value, or when a user oroccupant depresses the Front Press switch SW4 (FIG. 8) to power down thelighting fixtures manually and the system has subsequently timed out.When an occupant enters the room and the motion sensing circuit 76detects the occupant, the lighting fixtures 14 remain powered down ifthe measured ambient final value is greater than the CDS. Accordingly,the microprocessor 70 drives the LED 84" to solid green, indicatingdaylight inhibit is in effect. If daylight inhibit has not been selectedvia the daylight set switch SW6, the lighting fixtures are powered downand the LED 84" is driven to solid red to function as a night light. Foreach motion detected in the zone of operation, the microprocessor isprogrammed to flash off the operating LED from its solid green or redcolor. The flashing off for motion detected continues until the system10 times out, or the Front Press switch SW4 is depressed and the system10 accordingly times out. It is possible for the microprocessor toswitch from driving the solid red LED 84' to the solid green LED 84", orfrom the solid green LED 84" to the solid red LED 84', during this timeperiod. This transition in color indicates the level at which the CDS isset. Once the Front Press switch SW4 is depressed, the lighting fixturesare powered up, and the operating LED is powered down. The LED 84' issubsequently flashed red upon each detection of motion.

Once the lighting fixtures have been powered up, measured ambient lightlevels exceeding the CDS do not cause the lighting fixtures to bepowered down. The lighting fixtures remain powered up until the system10 times out as per the TO value, or the Front Press switch SW4 isdepressed. If the Front Press switch is depressed to power down thelighting fixtures, the system 10 is placed in a manual override mode.When in the manual override mode, the lighting fixtures remain powereddown for a 30 minute time out period from last detected motion. Asstated previously, this 30 minute period can be changed to other values.The lighting fixtures remain powered down until the Front Press switchis depressed, or the system 10 times out.

During the automatic mode of operation, lighting fixtures 14 remainpowered down when no occupant in the room is detected for a period oftime greater than the TO value or when the Front Press switch SW4 isdepressed to power down the lighting fixtures and the system 10 istiming itself out in accordance with the preset 30 minute TO valuedescribed above. The lighting fixtures remain powered down until anoccupant enters the room and is detected by the motion sensor. The redLED 84' flashes for each detection while the ambient light level in theroom is monitored. If the measured ambient light level final value isgreater than the CDS, the lighting fixtures remain powered down whilethe green LED 84" is driven to indicate that the daylight inhibitthreshold has been exceeded. While in the daylight inhibit mode, the LEDis flashed off for each detected motion. If the ambient light leveldecreases such that a new measured ambient light level final value isless than the CDS, the lighting fixtures are powered up upon the nextdetection of motion. If the ambient light level increases once again,the lighting fixtures are not powered down, but rather continue to bepowered up until the system 10 times out, or the Front Press switch SW4is depressed. Thus, unlike the manual mode, the lighting fixtures can bepowered up upon detection of motion and ambient light levels below theCDS, without having to use the Front Press switch. Once the lightingfixtures are powered on, the LEDs remain powered down, except whenflashing red upon detected motion, until the lighting control systemtimes out or is manually turned off via the Front Press switch.

When the lighting control system 10 is manually turned off via the FrontPress switch SW4 while in the automatic operational mode, the system isconsidered to be in the manual override mode. Once the lighting fixturesare powered down, the microprocessor sets the time out value to 30minutes in this example; however, the manual override time out periodcan be set to other values. The green or red LED is driven to a solidilluminated color depending on the presently measured ambient finalvalue. The LED remains a solid color and flashes off upon detectedmotion until it is returned to normal operation in the automatic mode.If the Front Press switch is depressed before time out, the lightingfixtures are once again powered up, and the system 10 is returned tonormal operation in the automatic mode. The LED changes from a solidcolor, lighting fixtures being powered down, to flashing red upondetection of motion.

When in the automatic mode, an occupant can power up the lightingfixtures either automatically or by overriding the daylight inhibitfunction. When the occupant wishes to present a slide show or giveanother type of presentation with the lighting fixtures powered down,the occupant does not expect much motion to occur. It is thereforepossible that the lighting control system can time out prematurely forthe audience due to the TO value and power up the lighting fixturesagain upon detected motion. The manual override feature is advantageousbecause it permits an occupant or user of an automatic system to powerdown the lighting fixtures, and have the present TO value setautomatically to a longer time out of, for example, 30 minutes. Thus,the system 10 operates using a 30 minute time out period, as opposed tothe most recent TO value. The most recent TO value remains unaffectedwhile the system 10 is in the manual override mode. The system 10subsequently times out 30 minutes after the last motion is detected orthe Front Press switch is depressed. The microprocessor 70 discards the30 minute TO value, and once again uses the most recent TO value storedin the EEPROM 72.

Since the LEDs 84' and 84" (FIG. 9) draw more current than mostcomponents of the lighting control system (e.g., typically four to eightmilliamps as compared to approximately 2 milliamps drawn by most circuitelements), the lighting control system 10 is configured to apply a dutycycle to the LEDs. For example, rather than driving an LED at a solidcolor for the entire time LED illumination is desired, themicroprocessor drives each LED at a solid color and essentially at fullbrightness using a steady state signal 90 for 100 milliseconds, drawing8 milliamps of current, and then pulses the LED at a frequency of lessthan 48 hertz at 4 milliamps for the remainder of the desired LEDillumination period, as shown in FIG. 11. The frequency is sufficientfor the LED 91 to appear to be solid to the human eye. Upon detection ofmotion, time out, activation of the Front Press switch or othercondition 92, the microprocessor drives the LED at full brightness again96 after a 100 millisecond period 94. The pulsing can be accomplishedusing a number of different methods. In accordance with one embodimentof the invention, the microprocessor is programmed to digitally controlthe duty cycling of the LED. The microprocessor outputs a pulse signalwhich is modulated using a step function. Another type of switchingdevice can be used in lieu of the microprocessor.

In accordance with another embodiment of the invention the duty cyclingof the LEDs is accomplished using an analog LED driver circuit 90 whichis depicted in FIG. 12. In this embodiment, the capacitor C1 chargesfrom a 5 volt signal via the resistor R1 and transistor Q1. The resistorR_(c) controls how quickly the capacitor C1 charges. A switch SW7 isshown to represent the microprocessor 70 or another type of switchingdevice. The microprocessor 70 does not generate a pulse signal butrather a steady state control signal to the base of transistor Q1. Thetransistor Q1 is turned off when the microprocessor or switching devicecloses and brings the base of the transistor Q1 to a low or zerovoltage. Accordingly, the transistors Q2 and Q3 become conductive, theenergy from the capacitor is discharged, and the LED is illuminated. Thecapacitor creates a pulsing effect via its discharging function, asshown in FIG. 13. Since the LED light level profile, including rate,duration, amplitude and slope, illustrated in FIG. 13 is a function ofthe resistor values, power source and the capacitor value, the resistorsare shown as potentiometers for illustrative purposes. The capacitorvalue can be adjusted to increase the brightness of the initial LEDflash and the duration of the subsequent brightness decay. The resistorsR_(HIGH) and R_(LED) control the steady state LED output. The resistorR_(u1) is preferably a nominal value and is used to control the state ofthe transistor Q1. If resistor R_(u1) is increased, transistor Q1 islikely to remain on. The current profile in FIG. 13 is therefore likelyto look more like a digital output, as shown by the line labelled R_(u1)=1 k ohm, than a gradually delaying linear output as shown by the linelabeled R_(u1) =0 ohm. The current profile in FIG. 13 can also beachieved using the digital implementation described in connection withFIG. 11 by altering, for example, the duty cycle of the pulsed outputsignal from the microprocessor.

The lighting control system 10 is configured to provide system userswith access to the various control switches, e.g., the TO set switchSW5, the fixed/adaptive timing mode switch SW2 and the daylight setswitch SW6. In addition, the lighting control system is configured topermit users to change preprogrammed values and switch states, asdescribed previously, to perform a test of system functions, and toaccomplish a master reset function. The external input device interface88 (FIG. 5) is in parallel with the EEPROM 72. An external input device(not shown) can be connected to the ports via J1-1 through J1-7 tocommunicate with the microprocessor 70 via the EEPROM 72. The externalinput device can therefore be used to enter or download data such as anew TO value, as well as a numerical pass code to ensure the user isauthorized to alter the operation of the system 10.

In accordance with another embodiment of the invention, the housing 24is provided with the jack 56 (FIG. 4) for connecting an externalhand-held device or other one-way or two-way communication device to themicroprocessor 70 to permit the downloading of data to, for example, theEEPROM 72 via twisted pair wires or a power line carrier. Further, theexternal communication device can download data simply via twisted pairwires without the jack. Thus, the maximum time out value can be changedfrom 30 to 60 minutes, in addition to changing other variables in theprogram code, providing failure modes and, providing sensor feedbackdata. Further, systems 10 can be configured for use remotely via thetwisted pair wires. For example, in addition to motion sensing, variousother sensors and transducers can be connected to the microprocessor 70.Several systems 10 can be controlled remotely by a central communicationprocessing device for light dimming, HVAC, security and climate controlpurposes.

In accordance with another embodiment of the invention, access tovarious control switches for the purposes of changing, for example, theTO or daylight set values can be restricted to selected system usersusing pass codes. The microprocessor is programmed to require receipt ofsignals from two or more of the switches SW2, SW4, SW5 and SW6, whichare depressed either simultaneously, or singularly and in a prescribedorder, in accordance with the pass code. The signals from the switch cancorrespond to a binary code which is compared by the microprocessor witha valid pass code stored in the EEPROM. Once the required signals areverified as a valid pass code, the microprocessor is programmed toaccept the user's changes to the configuration of the control systemusing the switches as described above. Occupants who do not know thepass code are not able to alter the system 10 using, for example, the TOset switch and the daylight set switch.

To perform a test of system functions, the microprocessor is connectedto an MPB-type test switch SW3 (FIG. 5), which, when depressed, createsa time out period of preferably 15 seconds using fixed timing as opposedto adaptive timing. The lighting control system preferably operates inthe fixed timing mode as opposed to the adapted timing mode duringtesting. In accordance with another embodiment of the invention, the TOset switch can be depressed for more than 3 seconds, and the TO valueset to 15 seconds in accordance with the procedure described above(i.e., one press) in order to enter the test mode. The test mode isexited by changing the DIP switch SW2 from the fixed timing position tothe adaptive timing position, allowing the system to time outautomatically 5 minutes from the time the test mode was entered, or bydepressing the TO set switch SW5 for greater than 3 seconds. A test modecan also be selected by using a combination of the daylight set switchSW6 and the Front Press switch SW4 corresponding to a pass code toachieve a 15 second daylight set value. Alternatively, the TO set switchSW5 and the Front Press switch SW4 can be depressed simultaneously forgreater than three seconds. For master reset, both the TO set switch andthe daylight set switch can be depressed simultaneously for 6 seconds.The microprocessor responds by resetting the TO and daylight set valuesto default values and subsequently resetting the microprocessor. Themicroprocessor drives the buzzer to generate a short, distinctive toneevery 2 seconds during the test mode. Since the system 10 times outafter a shortened TO period during the test mode, the system cannot beaccidentally left in the test mode, as can some existing lightingcontrol systems which require activation of a test switch to enter andto exit the test mode.

The buzzer BZ1 is preferably a tone generator model no. OBO-15220manufactured by Obo Seahorn Electronic Co., Ltd., Taipei, Taiwan. Thecircuit generates a 70 decibel, 500 to 4000 Hertz tone. The buzzerprovides a soft tone (e.g., 4 beeps over approximately a 0.5 secondduration) five seconds prior to time out to indicate an impending powerdown of the lighting fixtures, giving an occupant the opportunity toprevent false power down by moving. Thus, occupants are not left in aroom without light because they have not moved about sufficiently fortheir presence to be detected. The buzzer also provides other feedbackinformation to a user or occupant. For example, the buzzer generates asingle tone whenever any one (except the Front Press switch) of theswitches is depressed, and a series of tones when playing back thecurrent TO setting or setting the photocell sensor. The buzzer generatesa single tone upon successful power up, or when aborting a playback orsetting mode. The operation of the buzzer when using the TO set switchis described above.

Regarding the zero-crossing detection circuit 80 (FIG. 16), themicroprocessor coordinates relay K1 switching time with detectedzero-crossing times in the 60 Hertz AC power lighting circuit and delaysassociated with a number of devices in the control circuit. For example,the relay K1 requires approximately 2 milliseconds to open the lightingload circuit in response to a command from the microprocessor. Once acurrent zero-crossing is detected, the microprocessor subtracts thedelay associated with the relay K1 from the next zero-crossing (whichoccurs, for example, at 0, 8 and 16 milliseconds within a full cycle ofa 60 Hertz signal) to ensure that the contact opens at a zero currentlevel point in the power signal. Relay contact life is thereforeincreased.

The microprocessor determines the MTV by analyzing the level of occupantactivity in the field of view of the motion sensor, and performing asuccessive approximation to derive the optimum TO value between theminimum value established by the UST and the preprogrammed maximum value(e.g., 30 minutes). When the UST is too short, that is, the TO periodhas expired and an occupant's presence is still detected in the room,the occupant receives a tone generated by the buzzer. The tone ispreferably generated 5 seconds before the end of the TO period and,consequently, power down of the lighting fixtures. In the manual mode,an occupant has a grace period of approximately 10 seconds to create aneffective motion, that is, motion sufficient for detection, to cause themicroprocessor to power up the lighting fixtures once they have beenpowered down after time out. The occupant need not depress the FrontPress switch in order to power up the lighting fixtures when the systemis in the automatic mode. An occupant can, however, use the Front Pressto power down lighting fixtures which have been previously powered upautomatically.

The operation of the lighting control system will now be described inconnection with the flow chart depicted in FIG. 14. After the lightingcontrol system is installed (i.e., mounted on a wall and connected topower lines that supply AC power to lighting fixtures within theoperational area of the system), the power ON/OFF slide switch SW1 (FIG.16) is moved to the AUTO position (i.e., ON). Consequently, AC power isconverted to a DC voltage for operating the microprocessor 70. Themicroprocessor 70 subsequently undergoes initialization (block 100) anda self-test routine (block 102).

The microprocessor initially sets the following values: (1) the daylightthreshold value DTV=not operational or no daylight inhibit desired; (2)UST=15 minutes; (3) maximum allowable TO=30 minutes; (4) FIXED/ADAPTIVEswitch SW2 to adaptive timing mode; and (5) MANUAL/AUTO switch SW2 toautomatic operation mode. For subsequent start-ups (e.g., AC powerfailure or SW1 reset), these values are set to the most recent valuesentered by a user. Each time the system 10 is powered up, themicroprocessor undergoes a self-test routine that lasts approximately 10seconds. During the self-test routine, the microprocessor flashes theLEDs red and green, illuminates the light pipe to amber, and thenperforms a checksum operation on the contents of the microprocessor ROM.If the checksum confirms data integrity, the microprocessor flashes thegreen LED; otherwise, the self-test routine begins again. Themicroprocessor performs a RAM pattern test, that is, an EEPROMvalidation test, and determines whether or not a factory test jumper hasbeen installed. The green LED is flashed if the RAM pattern test isfailed; otherwise, the self-test routine begins again. If the EEPROM isvalid and no factory test jumper is installed, the green LED is flashed,and the self-test progresses. If the EEPROM is invalid or a test jumperis installed, factory defaults are read from the ROM and written to theEEPROM. The validity of the EEPROM is checked once, and then a secondtime if it is valid. If the first of these validity tests is failed, thefactory defaults are written to the EEPROM again. If the second validitytest is failed, the factory defaults are written to the EEPROM again,the red LED is flashed, and the buzzer is driven to generate two beeps.

The LEDs 84' and 84" are driven during self-test to indicate thefirmware revision number in binary code (e.g., a green LED flashrepresents a binary zero and a red LED flash represents a binary one).The lighting fixtures are powered up, and a timer is set to MTV. Themotion sensing circuit is permitted time to warm up. The microprocessor70 finally checks each MPB and switch to determine if any are on andtherefore are stuck, and generates flags accordingly. If the button orswitch that is stuck is later found to be unpressed, the correspondingflag is cleared from the EEPROM 72 for that button or switch.

Upon completion of a successful self-test, the buzzer BZ1 is driven togenerate a double tone before the microprocessor 70 continues to operatein accordance with the remaining sequence of operations in the mainroutine depicted in FIG. 14. If the system 10 has failed a non-criticalpart of the self-test (e.g., the Front Press switch is stuck, or themicroprocessor cannot read from the EEPROM), the microprocessor isprogramed to operate in a recovery mode. In the recovery mode, themicroprocessor initializes the system 10 in accordance with apredetermined alternative mode of operation or condition depending uponwhich part of the self-test was failed. For example, a fixed TO value isused if the TO set button is stuck and adaptive timing is selected.Default values are used in lieu of values stored in the EEPROM if theEEPROM is invalid. If the Front Press switch is stuck, themicroprocessor operates in accordance with the automatic and adaptivetiming modes. Automatic mode operation is used when the MANUAL/AUTOswitch is stuck. The recovery mode therefore gives occupants the benefitof a damaged or defective system 10 that is, for the most part,operational until it can be replaced or repaired. In the meantime, themicroprocessor is programmed to illuminate the LEDs in various feedbacksequences which indicate, in a unique manner, the reason for each systemmalfunction and, accordingly, self-test failure. If the system 10 ispowered up via relay SW1 but not operational, even in the recovery mode,the microprocessor repeatedly illuminates the LEDs to cyclicallyilluminate the light pipe wiring, for example, red, green and ambercolors.

With reference to block 104 in FIG. 14, the microprocessor determineswhether or not the Front Press switch SW4 (FIG. 16) has changed statesand saves the button state in the EEPROM. (block 106). The remainder ofthe flow chart shall hereinafter be described for illustrative purposesas if the system 10 is configured to operate in a manual mode, usingfixed versus adaptive timing, and with the daylight inhibit functiondisengaged. Descriptions of the automatic, adaptive timing, and thedaylight inhibit modes of operation will be described thereafter.

If the Front Press switch SW4 is determined to be stuck, themicroprocessor 70 forces the lighting control system 10 into theautomatic mode of operation (block 107). If the Front Press switch hasbeen depressed and the lighting fixtures are powered down (block 108),the microprocessor controls the relay K1 to power up the lightingfixtures (block 110). The microprocessor also clears TONE and GRACEflags which are defined in the program code and whose states are storedin the RAM. A timer (e.g., a counter or software-implemented timer)associated with the microprocessor is set to MTV (block 112). Since thelighting fixtures have been powered up as a result of a user or anoccupant pressing the Front Press switch, the microprocessor sets avariable called AUTO to the value one or zero, depending on the positionof the manual/AUTO switch SW, to cancel any manual override mode request(block 114). DTV is set to a value stored in the EEPROM, therebycanceling any offset invoked. The offset DTV is preferably canceled whenthe lighting fixtures are powered up for consistency. Thus, the system10 behaves the same way, whether the Front Press switch is depressed orthe occupant moves. The offset DTV is also canceled at GRACEEND.

If the lighting fixtures were already powered up when the Front Pressswitch was depressed (block 108), the microprocessor operates the relayK1 to power down the lighting fixtures (block 118). The timer issubsequently set to a slideshow value of 30 minutes in accordance withthe manual override function (block 120). The variable AUTO is set tozero to indicate that the system is in the manual override mode untiltime out is achieved (block 122).

If the motion sensing circuit detects motion in the lighted area (block124), a flag called MOTION is reset (block 126). GRACE and OLDLIGHTflags are set to represent that the system 10 is operating in a graceperiod and that the lighting fixtures were powered up before the startof the grace period. If the end of the grace period has not been reached(block 128), and the GRACE and OLDLIGHT flags have been set (block 130),the lighting fixtures are powered on (block 132) and DTV restored fromthe EEPROM 72. Thus, the lighting fixtures are powered up once againbecause motion was detected within the 10 second grace period followingtime out in the manual mode. The DTV is subsequently set from a valuestored in the EEPROM 72.

If the system 10 is operating in a manual override mode, the timer isset to the slideshow value of 30 minutes; otherwise, the timer is set toMTV which is equivalent to UST in the manual mode (block 134). Themicroprocessor resets the GRACE, GRACEEND, and the TONE flags (block136). The GRACE flag is set to one if the system 10 is operating in agrace period. The OLDLIGHT flag is set to one if the lighting fixtureswere powered up before time out. Since the lighting fixtures are poweredup (block 138), the red LED is driven to flash (block 140). A variableLASTLED is set at a binary number representing the current LED colorbeing displayed (block 142).

If motion is not detected (block 124), and if the system 10 has timedout, or the lighting fixtures are powered up, the microprocessor powersdown the LED (blocks 144 and 146). If time out has occurred (block 144)and the daylight inhibit function has been disabled, as in the presentexample, the red LED is powered up (block 150). The solid red LEDoperates as a nightlight, as stated previously, as long as no motion isdetected.

The microprocessor reads the value of the timer to determine if thereare fewer than 5 seconds left in the time out period and if the TONEflag is clear (block 152). If the TONE flag is clear (e.g., no tone hasbeen generated), the microprocessor drives the buzzer to generate a toneand sets the TONE flag to the value of one (block 154). If time out isreached (i.e., the timer value is zero) (block 156), and if the GRACEflag is set to indicate that the grace period is over (block 158), theGRACEEND flag is set to represent that true time out has occurred andthe grace period is over (block 160). The microprocessor sets thevariable AUTO to the value of one if the mode has changed to automaticoperation; otherwise, AUTO is set to the value of zero (block 162),which means the system 10 is set to operate in the manual mode. MTV isset to UST (block 163). Further, DTV is set to a value stored in theEEPROM.

If the GRACE flag is not set (block 158), that is, the grace period hasnot yet started, the microprocessor sets the GRACE flag to a value ofone value and sets the timer equivalent to the value of GRACETIME. Thevalue GRACETIME is stored in the EEPROM as ten seconds (block 164). TheOLDLIGHT flag is set to the value one if the lighting fixtures arepowered up; otherwise, it is set to a zero value (block 166). Themicroprocessor subsequently operates the relay K1 to power down thelighting fixtures (block 168). The microprocessor then performs aroutine to monitor the status of the time and daylight inhibit switchesSW5 and SW6 (block 170).

If the daylight inhibit function is enabled, the microprocessor 70drives the green LED (block 172) as opposed to the red LED when thesystem has not timed out. If adaptive timing has been selected in lieuof fixed timing, the microprocessor calculates a new MTV (block 174) inaccordance with a sequence of operations described below in connectionwith FIG. 15, provided the system is not in the manual override mode.

If the system is operating in the automatic mode, as opposed to themanual mode, a new MTV is calculated (block 174), and the lightingfixtures are powered up (block 132), provided the ambient light level isless than DTV when the daylight inhibit function is enabled. The timeris then reset to MTV (block 134). When operating in the automatic mode(block 176), the microprocessor determines if the ambient light level isgreater than DTV (block 178) and if the LASTLED is equivalent to a valuecorresponding to the color green (block 180). If the three conditions inblocks 176, 178 and 180 are true, the microprocessor does not power upthe lighting fixtures because of sufficient ambient light levelsdetected while operating in the daylight inhibit mode.

The calculation of MTV will be described now in connection with FIG. 15.This process is not undertaken by the microprocessor when the system isconfigured to operate in the fixed timing mode (block 190). Themicroprocessor reads TBM, MTV and TIMER from the EEPROM (block 192). Thevariable TBM corresponds to time between detected occurrences of motion,that is, the time that has elapsed since the last motion was detected.TBM can range in value from zero to MTV. If the lighting fixtures arepowered down, the microprocessor begins to calculate a new TBM when thenext detected motion occurs. A history of the most recent TBM values arestored on a FIFO basis in the EEPROM for calculating the average timebetween movements, which are hereinafter referred to as ATBM. The numberof time of motion samples depends on available memory and acceptableaccuracy. A history of the most recent times of motions and MTV valuesare preferably stored in a NVM to retain data after powering down thelighting control system. If the timer value is greater than MTV (block194), programmed control of the microprocessor continues as described inFIG. 14; otherwise, the microprocessor determines whether the mostrecent TBM is greater than one-half the value of UST (block 196).

The microprocessor 70 calculates the value ATBM to determine whether itis greater than seven-eights of MTV or within 12.5% of MTV (block 198).ATBM is calculated by taking a decaying average of successive TBM valuesand is useful as a guide for determining an adjusted TO value, that is,actual UST, instead of the UST value selected by the system user. Asindicated in block 196, ATBM is preferably updated only if TBM isgreater than half of UST. This criterion prevents successive movements,such as an occupant walking across the room, from causing unnecessaryadjustments to the ATBM value. One-half of UST is used as the criterioninstead of UST to permit adjustment of ATBM below the UST in the eventthat UST is a large value.

If ATBM is within 12.5% of MTV, MTV is adjusted to a greater value. WhenMTV is being increased, the following equation is used (block 200):##EQU1## In the present example, MAX is equal to 30 minutes. If ATBM isnot within 12.5% of MTV (block 198), the microprocessor determineswhether the TONE flag has been set (block 202). If it has, MTV isadjusted again to a larger value (block 200); otherwise, themicroprocessor determines whether TBM is greater than ATBM (block 204).

If time between movements (TBM) is greater than one-half of UST, and asmaller value than MTV less five seconds, MTV is adjusted to a smallervalue using the following equation (block 206): ##EQU2## If MTV isadjusted to a value that is less than UST (block 208), themicroprocessor 70 sets the MTV value equal to UST (block 210);otherwise, the MTV value calculated in block 206 is retained. In orderto prevent trivial EEPROM 72 updates, the new MTV value calculated inblocks 206 or 200 is not written to the EEPROM unless more than twominutes have elapsed since the last EEPROM update (blocks 212 and 214).The existing MTV value is written to variable MTVOLD and retained. Aswith the TBMs, successive MTV values are stored on a FIFO basis. ATBM issubsequently calculated using the most recent TBM value. The equationfor ATBM is as follows: ##EQU3##

The exemplary algorithm for determining MTV described above determines aTO value (i.e., MTV) larger than the UST to be the MTV. Themicroprocessor can, however, be programmed to derive a MTV that is lessthan the UST. Further, the microprocessor 70 can control the lightingcontrol system 10 without the user having to specify a UST at all, thatis, the microprocessor 70 tracks the occupants' motions over time toestablish a pattern of the occupants' habits and determines the optimumTO value without disrupting the occupant with false powering down of thelighting fixtures, while at the same time maximizing energy savings.

In accordance with another embodiment of the invention, a power supplycontrol circuit is depicted in FIG. 17 for use with the system 10. Thepower supply control circuit depicted in FIG. 17 is advantageous becauseit can operate with larger primary loads than the power supply circuitin FIG. 16, while preventing the transformer from becoming too hot. Thepower supply circuit provides pulsed power versus steady state power tocircuit components requiring more than a 5 volt regulated signal (e.g.,the relay K1, the buzzer and the LEDs) in accordance with a signalgenerated by the microprocessor. The transformer T1 is not required toprovide high, continuous secondary current (i.e., power demand) due tothe pulsed power demand load and therefore is not allowed sufficienttime to heat up to an undesirable temperature. Pulses are generated asrequired by the microprocessor after the LEDs, buzzer and relay K1 areenergized so that the capacitor C17 can be recharged. When themicroprocessor asserts a pulsed signal (e.g., a 5 volt signal, or a lowsignal if transistor Q8 is a PNP-type transistor) to the transistor Q8,the transistors Q7 and Q8 conduct and therefore shunt higher currentaround the resistor R45 to the capacitor C17 for a fast charge fordischarging at a later time when, for example, the 8.2 volt supply isneeded to energize a system 10 component such as the buzzer BZ1. Thediode D18 shunt regulates 8.2 volts to limit the voltage operationalratings of the capacitor C17 and other loads. The power supply controlcircuit allows increased line side or lighting fixture load, whiledecreasing the transformer T1 temperature and the current drawn from itssecondary winding. The secondary winding current is maintained at alevel only as high as necessary to drive secondary circuits.

In accordance with another aspect of the invention, the system 10 isconfigured for factory testing various components thereof. The PCB 46 ispreferably electronically connected to a power board comprising thecomponents depicted in FIG. 16 via a high current ribbon cable. The twoboards can then be inserted into a test fixture. To begin the test, anumber of pins or pads on one of the boards can be mechanicallyconnected to an external test plug or to pogo pins. The test mode can beinitialized or asserted through the mechanical connection or from anexternal computer via the pins and pads. Alternatively, the test modecan be initialized or asserted electronically via an external computervia the external input device interface 88 or the jack 36 or twistedpair. Further, a dedicated test switch SW3 (FIG. 5) can be activated.

With reference to FIG. 18, the microprocessor is programmed duringfactory testing to flash the LEDs 84' and 84" to illuminate the lightpipe to an amber color (block 220). The microprocessor proceeds to waita period of time (e.g., 500 milliseconds) before performing a checksumoperation on the microprocessor's ROM (block 222). The microprocessorchecks the first byte from the EEPROM to see if a match exists with therevision number of the software in the ROM. The microprocessor reads inall of the EEPROM to the RAM and then performs a triple redundancy testof all three memory locations (i.e., the microprocessor ROM and RAM andthe EEPROM 72). If two out of the three memory locations do not matchafter a total of three of attempts, the default values in the ROM areused. If the checksum reveals no problems with the ROM (block 224), themicroprocessor flashes the green LED 84" (block 226) and waits a periodof time (e.g., 500 milliseconds) before performing a RAM pattern test(block 228). If there is a problem with the ROM, the test engineer isnotified by the LEDs being driven again to illuminate the light pipe anamber color. Similarly, if the RAM pattern test fails, the engineer isnotified by the flashing amber light pipe (block 230). Themicroprocessor then generates a tone via the buzzer BZ1 after asuccessful RAM pattern test (block 232). Fail codes can be stored usinga memory device (e.g., EEPROM 72 or the ROM on the microprocessor 70).An external emulator can therefore read from the memory device todetermine where the system 10 failed.

With reference to block 234 of FIG. 18, the microprocessor drives theLEDs 84' and 84" in a sequential manner to indicate the firmwarerevision number (e.g., a number of red LED 84' flashes followed by anumber of green LED 84" flashes which correspond to a binary revisionnumber). After turning off the relay K1 (block 235), the microprocessorperforms a test switch routine for each of the switches, that is the TOset switch SW5, the daylight set switch SW6, the slide switch SW1, andthe MANUAL/AUTO and the FIXED/ADAPTIVE timing switches in the DIP switchSW2 (blocks 234, 236, 238, 240, 242 and 244, respectively). The testswitch routine generally involves asserting the factory test, forexample, using the switch SW3 or the pins or pads.

When the factory test switch (e.g., switch SW3) is toggled or depressedin the factory test mode, the microprocessor 70 single steps through thefactory test routine stored within the ROM or the EEPROM 72. One or moretests can be performed for each button press or from an externallydriven activator or computer.

The microprocessor 70 can employ two-way communication for testequipment use, as well for interfacing addressable networks (e.g.,Echelon® LONWORKS Technology™). In a network capable product, the powersupply circuit board (FIG. 17) can be enhanced with a configurabletransceiver on or off the board which allows interfacing to numeroussystem addressable, physical network types (e.g., twisted pair, radiofrequency, link power, infrared transmission, power line communication,and so on). The transceiver is physically connected via an RJ-11connector, terminal block or a similar type of connector. This allowsaccess to the microprocessor 70 and the EEPROM 72, or the microprocessorROM and RAM, for reporting purposes and for configuration of variables.For a test equipment interface, fail codes, process control and testingcan be controlled from the microprocessor 70 or an external computer.The microprocessor can inhibit the factory test engineer from proceedingwith testing if the system 10 fails a test. Physical interconnectionsare provided via test pads on the PCB 46 for test pin access (e.g., pogopin). These physical interconnections allow testing to be conducted,diagnostic information to be read, configuration of system variables,interfacing with LONWORKS™ or other types of generic or specific LANs,network configuration of standard configuration parameter types (SCPT)and standard network variable types (SNVT). With this implementation,the system 10 can additionally control a lighting fixture dimmingactuator, report occupancy status (e.g., security use), and providefeedback for building control equipment (e.g., HVAC).

With continued reference to FIG. 18, the relay K1 is placed in aninitial state (i.e., open or OFF) by the microprocessor (block 246) andthen closed (block 250). After the factory test is negated and thenreasserted to test the relay (block 252), the relay is opened (block254). The factory test is negated and then reasserted (block 256) beforethe photocell trimmer lines are adjusted for improved readings (block258). The trimmer state is stored in the EEPROM 72 (block 260). If thephotocell is greater than one-half its scale during its calibrationtest, the green LED 84" is flashed (passed) (block 264); otherwise, thered LED 84' is flashed (failed) (block 266). The microprocessor waitsfor a period of time to elapse (e.g., 500 milliseconds) (block 268)before determining if the photocell is greater than one-half its scale(blocks 270 and 262).

After the factory test is reasserted (block 272), the microprocessorclears the zero-cross flag (block 274). One of the LEDs is flashed afterthe zero-cross flag is set (blocks 276 and 278). The motion sensingcircuit 76 is then tested after the factory test is reasserted (block280) by using an external infrared heat source or the presence of aperson (block 282). If motion is detected, the red LED 84' is flashed(block 284); otherwise, the green LED 84" is flashed (block 286). Themicroprocessor waits for a period of time to elapse (block 288) beforedetermining if another output signal has been generated by the motionsensing circuit 76 in response to detected motion.

The microprocessor can be programmed to power up and power down lightingfixtures differently depending on the character of the zone in which thelighting control system is installed. For example, tolerant andintolerant zones can be defined whereby the microprocessor 70 isprogrammed to be more sensitive to detected motion in an intolerant zonethan in a tolerant zone. This feature is particularly useful, forexample, for an office that has a significant amount of employeeactivity during the daytime versus nighttime, or vice versa. In the caseof a busy daytime office, the likelihood that detected motion atnighttime is that of an employee is small. The motion detected duringthis period is more likely an external noise source such as awalkie-talkie carried by a guard outside the zone. Thus, themicroprocessor can be programmed to operate in a tolerant zone andrequire motion sensor output signals to be characterized by a greatermagnitude, duration, or frequency or a different duty cycle, or acombination of these signal characteristics, before the lightingfixtures are powered up via the relay K1. A microprocessor operating inan intolerant zone, on the other hand, is programmed to respond todetected noise without excessive delay.

In addition to the previously described tolerant/intolerant zones, thefollowing two processes can be employed. Acceptable slew rates, that is,analog signals at test point T2 (FIG. 7) representing change in voltageover time or dv/dt can be programmed and changed in the EEPROM 72 viaslew rate software 290. At present, the minimum acceptable slew rate isgreater than or equal to 5 volts per millisecond, and the maximumacceptable is 15 volts per millisecond. Slew rates less than 5 volts permillisecond or greater than 15 volts per millisecond are ignored. Thiscreates a software bandpass filter. The numerical occurrences of theseslew rates can be selectively counted by a counter 292. The output ofthe counter (e.g., 1 to X counts) becomes a valid occupant signal VOS.In addition, the counter provides added verification since it requiresmultiple dv/dt's (count>1) and therefore provides filtering to reducefalse VOS due to outside noise mechanisms.

This software emulates a hardware variable reference window comparator.An analog-to-digital converter ADC 294 is calibrated to the 1/2 VCCquiescent operating point. With an 8-bit ADC, this is 80H (hexadecimal).Calibration is done by connecting TP1 to TP3 and storing the ADC's valueas the V quiescent. (V_(q)) operating point. This compensates for any DCoffset associated with the second stage of the amplifier U1B (FIG. 7). Avalue can be set above and below the V_(q) which defines the V_(TH) trippoint. For example, if 80H=V_(q), 1 bit is approximately 20 mV_(q).Thus, to select a ±500 mv V_(th), the ADC upper (+) operating point=9AHand the lower (-) operating point=66 H. Values between 9AH and 66H areignored. The numerical occurrences of values outside this range can beselectively counted by the V_(TH) software 296 and a counter 298, atwhich point the counter output (1 to X counts) becomes a valid occupantsignal (VOS). The counter 298 provides added verification since itrequires multiple V_(TH) 's, thus providing filtering to reduce falseVOS due to outside noise mechanisms.

A sequence/select mixer 300 controls the type and sequence mix of dv/dtVOS and ±V_(TH) VOS that optimize signal processing for a givenapplication. For example, high noise environments may require a highercount of dv/dt's to produce a VOS than an environment which requires afast response and high sensitivity. In the latter case, the ±V_(TH) VOSwith counter=1 can be selected. Various combinations of required tripVOS to maintain VOS can be sequenced and mixed using the SSM 300.

SSM 300 operation can be varied based on the state of relative timeclock (RTC), that is, by effectively choosing the optimum signal processbased on the occupant's "signature" and time of day. Thus, adaptivesensitivity can be implemented. For example, during a tolerant timeperiod, the V_(TH) is increased, requiring a greater signal to raise thethreshold level, along with a counter 298 value set to greater than 1.This would cause the system 10 to be less sensitive, e.g., need moremotion to respond; however, once a VOS is passed, the sensitivity can beincreased (e.g., count=1 and V_(TH) decreased) to respond to less motionwhile the occupant is present with an RTC=daytime. If RTC=nighttime,sensitivity is not increased in this manner.

An exemplary PCB 46 is depicted in FIGS. 20 and 21 which can be usedwithin the housing 24 (FIG. 2). The PCB comprises the componentsdepicted in FIG. 5, some of which are shown here, i.e., the relay K1,the transformer T1, the slide switch SW1 and the motion sensor X1 (FIG.7). The PCB is preferably a perforated board with the two halves beingelectrically connected by a ribbon cable 308. Thus, the PCB in FIG. 20can be inverted as shown in FIG. 21 to reduce its planar area forinsertion into the housing 24. Test pins 306 are provided on both sidesof the PCB and on either side of the perforation 310. The pins 306 allowa test engineer to access the system 10 components when, for example,the housing 24 is open (i.e., by removing the bracket) and is connectedto a test fixture.

While certain advantageous embodiments have been chosen to illustratethe invention, it will be understood by those skilled in the art thatvarious changes and modifications can be made herein without departingfrom the scope of the invention as defined in the appended claims.

What is claimed is:
 1. A method of controlling an electrical load for anoccupant in an area in which the load operates, comprising the stepsof:detecting energy in said area using a single motion sensor;generating a detector signal representing said energy detected by saidmotion sensor; processing said detector signal to determine if saiddetected energy indicates the presence of said occupant in said area andto generate an occupancy signal if said detected energy indicates thepresence of said occupant in said area; repeating said detecting step,said generating step and said processing step to generate a plurality ofsaid detector signals for which a corresponding plurality of saidoccupancy signals is generated; storing data corresponding to saidplurality of said detector signals; and automatically modifying saidprocessing step for processing a future said detector signal inaccordance with said stored data to adjust the amount of said detectedenergy that is required to generate a corresponding said occupancysignal.
 2. A method as claimed in claim 1, further comprising the stepof operating said load when said occupancy signal is generated.
 3. Amethod as claimed in claim 1, wherein said processing step comprises thestep of determining if a selected signal characteristic of said detectorsignal is within a predetermined range of values.
 4. A method as claimedin claim 3, wherein said detector signal is the quiescent operatingpoint of an analog-digital converter associated with a motion sensor,and said selected signal characteristic is a threshold voltagecorresponding to said quiescent operating point.
 5. A system forselectively providing power from a power source to at least one load tooperate in an area for at least one occupant, comprising:a switchingdevice configured to provide a current conduction path between saidpower source and said load when in a closed position, and to interruptsaid path when in an open position; a processing device connected tosaid switching device for controlling when said switching device is insaid open position and when said switching device is in said closedposition; a memory device associated with said processing device forstoring program code, said processing device being programmable tocontrol said switching device in accordance with said program code; anda single motion sensor connected to said processing device for detectingenergy in said area and for providing a detector signal to saidprocessing device; wherein said processing device is programmable toprocess said detector signal to determine if said detected energyindicates the presence of said occupant in said area and to generate anoccupancy signal if said detected energy indicates the presence of saidoccupant in said area, to process a plurality of detector signalsgenerated by said sensor until a corresponding plurality of saidoccupancy signals is generated, to store data corresponding to saidplurality of detector signals, and to automatically modify processing ofa future said detector signal in accordance with said stored data toadjust the amount of said detected energy that is required from saidsensor to generate a corresponding said occupancy signal.
 6. Anapparatus as claimed in claim 5, wherein said processing device isoperable to close said switching device upon generation of saidoccupancy signal.
 7. An apparatus as claimed in claim 5, wherein saidprocessing device is operable to determine if a selected signalcharacteristic of said detector signal is within a predetermined rangeof values.
 8. An apparatus as claimed in claim 7, wherein said detectorsignal is the quiescent operating point of an analog-to-digitalconverter associated with said sensor, and said selected signalcharacteristic is a threshold voltage corresponding to said quiescentoperating point.
 9. An apparatus for automatically adjusting thesensitivity of an occupancy detector comprising:slew rate determinationmeans for determining the change in voltage measured at the output ofsaid occupancy detector over a period of time; a first counter connectedto said slew rate determination means, said slew rate determinationmeans being operable to operate said first counter when an output signalgenerated by said occupancy detector is within a selected range ofvalues representing desired changes in said voltage; analog-to-digitalconversion means connected to said occupancy detector, a second counter,voltage threshold means connected to said analog-to-digital conversionmeans and said second counter and operable to determine when saidoccupancy detector operates outside a predetermined range of valuesrepresenting desirable operating points; and a mixer connected to saidslew rate determination means and said voltage threshold means forselecting a number of slew rate signals corresponding to respective saidchanges in said voltages and a number of trip voltage signalscorresponding to said desirable operating points using said firstcounter and said second counter to determine when an occupant isdetected.
 10. An apparatus as claimed in claim 9, wherein said mixer isconfigured to adjust the sensitivity of said occupancy detector byadjusting the numbers of said slew rate signals and said trip voltagesignals required to determine the presence of said occupant.
 11. Anapparatus as claimed in claim 10, wherein operation of said mixer can beadjusted in accordance with the time of day.
 12. An apparatus as claimedin claim 10, wherein different occupants in an area in which saidoccupancy detector operates are characterized by different energypatterns detected by said occupancy detector, and operation of saidmixer can be adjusted in accordance with said energy patterns.
 13. Anapparatus for controlling the ON/OFF state of an electrical devicecomprising:a passive infrared sensor operable to generate a first signalindicating the presence of an occupant in an area; a noise processingdevice operable to detect noise and to generate a second signal whensaid noise processing device determines that noise meets pre-definedcriteria; a control device in electronic communication with said passiveinfrared sensor and said noise processing device, said control meansbeing operable to maintain said electrical device in an ON state whensaid control means receives one of said first signal from said passiveinfrared sensor indicating the presence of said occupant in said area,and said second signal from said noise processing device when noisemeets said pre-defined criteria; wherein said control device is operableto initiate an OFF state when said passive infrared sensor has notgenerated said first signal indicating the presence of said occupant insaid area and said noise processing device determines that noise has notmet said pre-defined criteria for a predetermined length of time; andsaid noise processing device is configurable to require said pre-definedcriteria to meet different ones of a plurality of selected criteriacorresponding to different levels of sensitivity of said noiseprocessing device to noise.
 14. An apparatus as claimed in claim 13,wherein said noise processing device comprises an operational amplifierconnected to said passive infrared sensor, said pre-defined criteriacorresponding to the quiescent operating point of said operationalamplifier.
 15. An apparatus as claimed in claim 13, wherein the outputof said noise processing device is at least one of a plurality of slewrates corresponding to changes in voltage over a period of time measuredat the output of said passive infrared sensor, said operating pointcorresponding to said plurality of slew rates, said pre-defined criteriacorresponding to a selected range of said plurality of said slew rates.16. An apparatus as claimed in claim 15, wherein said noise processingdevice comprises a counter for determining the number of occurrencesthat said slew rate at the output of said passive infrared sensorexceeds said selected range of slew rates, the value of said counterrequired before said control device initiates an ON state beingadjustable in accordance with the amount of noise that will be toleratedby said apparatus.
 17. An apparatus as claimed in claim 16, wherein saidnoise processing device comprises an operational amplifier connected tosaid passive infrared sensor, said pre-defined criteria corresponding toat least one of the quiescent operating point of said operationalamplifier and a selected offset value from said quiescent operatingpoint.
 18. An apparatus as claimed in claim 17, further comprising asecond counter for determining the number of occurrences that saidpre-defined criteria exceed said selected offset value, the value ofsaid second counter required before said control device initiates an ONstate being adjustable in accordance with the amount of noise that willbe tolerated by said apparatus.
 19. An apparatus as claimed in claim 18,further comprising a mixer device for receiving output signals from saidcounter and said second counter, said mixer device being configured torequire at least one of a selected sequence and a selected combinationof said output signals from respective ones of said counter and saidsecond counter before said control device initiates an ON state beingadjustable in accordance with the amount of noise that will be toleratedby said apparatus.
 20. A method of controlling an electrical load for anoccupant in an area in which the load operates, comprising the stepsof:detecting energy in said area; generating a detector signalrepresenting said detected energy; processing said detector signal todetermine if said detected energy indicates the presence of saidoccupant in said area and to generate an occupancy signal if saiddetected energy indicates the presence of said occupant in said area;repeating said detecting step, said generating step and said processingstep to generate a plurality of said detector signals for which acorresponding plurality of said occupancy signals is generated; storingdata corresponding to said plurality of said detector signals; andautomatically modifying said processing step for processing a futuresaid detector signal in accordance with said stored data to adjust theamount of said detected energy that is required to generate acorresponding said occupancy signal; wherein said processing stepcomprises the step of determining if a selected signal characteristic ofsaid detector signal is within a predetermined range of values and saiddetector signal represents a change in voltage over a period of timemeasured at the output of a motion sensor, and said selected signalcharacteristic corresponds to a slew rate.
 21. A method of controllingan electrical load for an occupant in an area in which the loadoperates, comprising the steps of:detecting energy in said area;generating a detector signal representing said detected energy;processing said detector signal to determine if said detected energyindicates the presence of said occupant in said area and to generate anoccupancy signal if said detected energy indicates the presence of saidoccupant in said area; repeating said detecting step, said generatingstep and said processing step to generate a plurality of said detectorsignals for which a corresponding plurality of said occupancy signals isgenerated; storing data corresponding to said plurality of said detectorsignals; and automatically modifying said processing step for processinga future said detector signal in accordance with said stored data toadjust the amount of said detected energy that is required to generate acorresponding said occupancy signal; wherein said processing stepcomprises the step of determining if a selected signal characteristic ofsaid detector signal is within a predetermined range of values and saidstoring step comprises the step of incrementing a counter when saiddetector signal is determined to be within said predetermined range ofvalues.
 22. A method as claimed in claim 21, wherein said automaticallymodifying step comprises the step of generating said occupancy signalwhen said counter reaches a selected value using a number of saiddetector signals in lieu of generating said occupancy signal using asingle corresponding said detector signal.
 23. A method as claimed inclaim 22, wherein said automatically modifying step further comprisesthe step of changing at least one of said selected value of said counterand said predetermined range of values.
 24. A method as claimed in claim23, wherein said changing step is implemented in accordance with aselected time of day.
 25. A method as claimed in claim 23, wherein anoccupant's use of said area is characterized by a signature energypattern, and said changing step comprises the step of selecting at leastone of said selected value of said counter and said predetermined rangeof values in accordance with said signature energy pattern.
 26. A methodas claimed in claim 25, wherein said changing step further comprises thestep of selecting at least one of said selected value of said counterand said predetermined range of values in accordance with a selectedtime of day.
 27. A method as claimed in claim 26, wherein said detectorsignal represents the quiescent operating point of an analog-to-digitalconverter associated with a motion sensor, and said selected signalcharacteristic is a threshold voltage corresponding to said quiescentoperating point.
 28. A method as claimed in claim 26, wherein saiddetector signal indicates a change in voltage over a period of timemeasured at the output of a motion sensor, and said selected signalcharacteristic corresponds to a slew rate.
 29. A method as claimed inclaim 28, wherein said detector signal represents the quiescentoperating point of an analog-to-digital converter associated with amotion sensor, and said selected signal characteristic is a thresholdvoltage corresponding to said quiescent operating point.
 30. A method asclaimed in claim 29, wherein said automatically modifying step comprisesthe step of selecting a sequence and mix of said detector signalsindicating a change in voltage over a period of time measured at theoutput of a motion sensor, and said detector signals representing thequiescent operating point of an analog-digital converter associated witha motion sensor required to generate said occupancy signal.
 31. A systemfor selectively providing power from a power source to at least one loadto operate in an area for at least one occupant, comprising:a switchingdevice configured to provide a current conduction path between saidpower source and said load when in a closed position, and to interruptsaid path when in an open position; a processing device connected tosaid switching device for controlling when said switching device is insaid open position and when said switching device is in said closedposition; a memory device associated with said processing device forstoring program code, said processing device being programmable tocontrol said switching device in accordance with said program code; anda sensor connected to said processing device for detecting energy insaid area and for providing a detector signal to said processing device;wherein said processing device is programmable to process said detectorsignal to determine if said detected energy indicates the presence ofsaid occupant in said area and to generate an occupancy signal if saiddetected energy indicates the presence of said occupant in said area, toprocess a plurality of detector signals generated by said sensor until acorresponding plurality of said occupancy signals is generated, to storedata corresponding to said plurality of detector signals, and toautomatically modify processing of a future said detector signal inaccordance with said stored data to adjust the amount of said detectedenergy that is required from said sensor to generate a correspondingsaid occupancy signal, and said processing device is operable todetermine if a selected signal characteristic of said detector signal iswithin a predetermined range of values, said detector signalrepresenting a change in voltage over a period of time measured at theoutput of a motion sensor, and said selected signal characteristiccorresponding to a slew rate.
 32. A system for selectively providingpower from a power source to at least one load to operate in an area forat least one occupant, comprising:a switching device configured toprovide a current conduction path between said power source and saidload when in a closed position, and to interrupt said path when in anopen position; a processing device connected to said switching devicefor controlling when said switching device is in said open position andwhen said switching device is in said closed position; a memory deviceassociated with said processing device for storing program code, saidprocessing device being programmable to control said switching device inaccordance with said program code; a sensor connected to said processingdevice for detecting energy in said area and for providing a detectorsignal to said processing device, said processing device beingprogrammable to process said detector signal to determine if saiddetected energy indicates the presence of said occupant in said area andto generate an occupancy signal if said detected energy indicates thepresence of said occupant in said area, to process a plurality ofdetector signals generated by said sensor until a correspondingplurality of said occupancy signals is generated, to store datacorresponding to said plurality of detector signals, and toautomatically modify processing of a future said detector signal inaccordance with said stored data to adjust the amount of said detectedenergy that is required from said sensor to generate a correspondingsaid occupancy signal, said processing device being operable todetermine if a selected signal characteristic of said detector signal iswithin a predetermined range of values; and a counter associated withsaid processing device, said processing device being operable toincrement said counter when said detector signal is determined to bewithin said predetermined range of values.
 33. An apparatus as claimedin claim 32, wherein said processing device is operable to generate saidoccupancy signal when said counter reaches a selected value using anumber of said detector signals in lieu of generating said occupancysignal using a single corresponding said detector signal.
 34. Anapparatus as claimed in claim 33, wherein said processing device isoperable to change at least one of said selected value of said counterand said predetermined range of values.
 35. An apparatus as claimed inclaim 34, wherein said processing device is operable to change at leastone of said selected value of said counter and said predetermined rangeof values in accordance with a selected time of day.
 36. An apparatus asclaimed in claim 34, wherein use of said area by said occupant ischaracterized by a signature energy pattern, and said processing deviceis operable to select at least one of said selected value of saidcounter and said predetermined range of values in accordance with saidsignature energy pattern.
 37. An apparatus as claimed in claim 36,wherein said processing device is further operable to select at leastone of said selected value of said counter and said predetermined rangeof values in accordance with a selected time of day.
 38. An apparatus asclaimed in claim 37, wherein said detector signal represents thequiescent operating point of an analog-to-digital converter associatedwith said sensor, and said selected signal characteristic is a thresholdvoltage corresponding to said quiescent operating point.
 39. Anapparatus as claimed in claim 37, wherein said detector signal indicatesa change in voltage over a period of time measured at the output of saidsensor, and said selected signal characteristic corresponds to a slewrate.
 40. An apparatus as claimed in claim 39, wherein said detectorsignal represents the quiescent operating point of an analog-to-digitalconverter associated with said sensor, and said selected signalcharacteristic is a threshold voltage corresponding to said quiescentoperating point.
 41. An apparatus as claimed in claim 40, wherein saidprocessing device is operable to select a sequence and mix of saiddetector signals indicating a change in voltage over a period of timemeasured at the output of a motion sensor, and said detector signalsrepresenting the quiescent operating point of an analog-to-digitalconverter associated with a motion sensor required to generate saidoccupancy signal.